<template>
  <div id="app">
    <router-view></router-view>
  </div>
</template>

<script>
  import instance from './utils/request'
  import {base_url} from './utils/baseURL'
  export default {
    data(){
      return {
        userinfo:null
      }
    },
    name: 'App',
    components: {
      
    },
    created(){
     if(sessionStorage.userinfo){
      let userId = JSON.parse(sessionStorage.userinfo)._id
      instance.get(`${base_url}cartgoods`,{
          params:{
            userId  
          }
      }).then(res=>{
        this.$store.commit('huang/cartGoodsMut',res.data.data);
      })
      instance.get(`${base_url}address`,{
          params:{
            userId  
          }
      }).then(res=>{
        this.$store.commit('address/getAddressMut',res.data.data);
      })
    }
     }
  }
</script>

<style lang="less">


</style>
